<?php
// Khai bao namespace
namespace Admin\Controller;

use Zend\Mvc\Controller\AbstractActionController;
use Zend\View\Model\ViewModel;
use Admin\Model\Base;
use Admin\Model\Userpower;
use Admin\Model\User;

class UserController extends AbstractActionController
{

    public function indexAction ()
    {
        $userTable = $this->getServiceLocator()->get('Admin\Model\UserTable');
        return new ViewModel(array(
            'users' => $userTable->fetchAll()
        ));
    }

    public function addAction ()
    {
        $user = new User();
        $view = new ViewModel(array(
            'website' => $user->getTable(),
        ));
        return $view;
    }
}

